package com.mywang.weitravel.modules.company;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.mywang.weitravel.R;
import com.mywang.weitravel.base.BaseActivity;
import com.mywang.weitravel.base.BaseContract;
import com.mywang.weitravel.modules.manbushanghai.X5WebView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by wangmingyun on 2019/12/11.
 */
public class CompanyActivity extends BaseActivity {
    @BindView(R.id.iv_title_back)
    ImageView ivTitleBack;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.webview)
    X5WebView webview;
    @BindView(R.id.iv_one)
    ImageView ivOne;
    @BindView(R.id.iv_two)
    ImageView ivTwo;
    @BindView(R.id.iv_three)
    ImageView ivThree;

    private String urls[] = {"https://m.ctrip.com/webapp/you/sight/2.html?navBarStyle=white&from=https%3A%2F%2Fm.ctrip.com%2Fwebapp%2Fyou%2Fplace%2F2.html%3Fishideheader%3Dtrue%26from%3Dhttps%253A%252F%252Fm.ctrip.com%252Fhtml5%252F%253Fautoawaken%253Dclose%2526jumpHome%253D1",
            "https://oando.com.cn/shjinlv/index.html?from=singlemessage&isappinstalled=0",
            "https://m.springtour.com/guonei"};

    @Override
    protected void initView() {
        tvTitle.setText("企业之窗");
        webview.loadUrl(urls[0]);
    }

    @Override
    protected BaseContract.IPresenter initPresenter() {
        return null;
    }

    @Override
    protected int getActivityLayoutID() {
        return R.layout.activity_company;
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick({R.id.iv_title_back, R.id.iv_one, R.id.iv_two, R.id.iv_three})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_title_back:
                finish();
                break;
            case R.id.iv_one:
                webview.loadUrl(urls[0]);
                break;
            case R.id.iv_two:
                webview.loadUrl(urls[1]);
                break;
            case R.id.iv_three:
                webview.loadUrl(urls[2]);
                break;
        }
    }
}
